import 'package:flutter/material.dart';


class CircleProgressBar extends StatefulWidget {
  final String text;

  const CircleProgressBar({Key? key, required this.text}) : super(key: key);

  @override
  State<StatefulWidget> createState() => _CircleProgressBar();
}

class _CircleProgressBar extends State<CircleProgressBar> {
  @override
  Widget build(BuildContext context) {
    return Stack(alignment: Alignment.center, children: [
      Container(
        width: 140,
        height: 140,
        padding: EdgeInsets.all(15),
        decoration: BoxDecoration(
          shape: BoxShape.circle,
          color: Colors.white,
          boxShadow: [
            BoxShadow(
              color: Colors.lightBlueAccent.withOpacity(0.5),
              spreadRadius: 2,
              blurRadius: 2,
              blurStyle: BlurStyle.outer,
              offset: Offset(0, 0), // changes position of shadow
            ),
          ],
        ),
        child: CircularProgressIndicator(
          value: 0.75,
          backgroundColor: Colors.grey.withAlpha(80),
          valueColor: AlwaysStoppedAnimation(Colors.lightBlueAccent),
          strokeWidth: 6,
        ),
        // child: GradientCircularProgressIndicator(value: 0.75),
      ),
      Container(
          width: 50,
          height: 50,
          margin: EdgeInsets.all(5),
          alignment: Alignment.center,
          decoration: BoxDecoration(
              shape: BoxShape.circle,
              color: Colors.lightBlueAccent,
              boxShadow: [
                BoxShadow(
                  color: Colors.black.withOpacity(0.2),
                  spreadRadius: 5,
                  blurRadius: 5,
                  blurStyle: BlurStyle.outer,
                  offset: Offset(0, 0), // changes position of shadow
                ),
              ],
              gradient: LinearGradient(
                  begin: Alignment.bottomCenter,
                  end: Alignment.topCenter,
                  colors: [
                    Colors.lightBlueAccent,
                    Colors.lightBlueAccent.withAlpha(90)
                  ])),
          child: Text(
            widget.text,
            style: TextStyle(color: Colors.black),
          ))
    ]);
  }
}
